function [mix vars] = killComponentSmallest(mix, data, vars, heuristic, algname)


switch heuristic
    case 'lowerbound'
        switch algname
            case 'kmeansbayes'
                lls = kmeansBayesLowerboundLosses(mix, data, vars);
                
            case 'gmmbayes'
                lls = gmmBayesLowerboundLosses(mix, data, vars);

            case 'gmmbayesuncertainty'
                lls = gmmBayesLowerboundUncertaintyLosses(mix, data, vars);

            case 'gmmbayesverbeek'
                lls = gmmBayesLowerboundVerbeekLosses(mix, data, vars);
                
            otherwise
                error('no algname selected');
        end
        [temp least_comp] = max(lls);
                
    case 'assignments'
        kls = sum(vars.Z.*log(vars.Z+realmin)) - sum(vars.Z.*log(1-vars.Z+realmin));
        [temp least_comp] = min(kls);
        
    case 'figureido'
        [temp least_comp] = min(mix.priors);

    otherwise
        error('no heuristic selected');
end

[mix vars] = killComponents(mix, vars, least_comp);
